package com.demo;

import com.jfinal.config.*;
import com.jfinal.plugin.activerecord.ActiveRecordPlugin;
import com.jfinal.plugin.c3p0.C3p0Plugin;
import com.jfinal.template.Engine;

/**
 * Created by chaiyuan on 2017/5/2.
 */
public class DemoConfig extends JFinalConfig {
    public void configConstant(Constants me)
    { me.setDevMode(true);

    }
    public void configRoute(Routes me)
    { me.add("/hello", HelloController.class);
    }

    @Override
    public void configEngine(Engine me) {

    }

    public void configPlugin(Plugins me) {
//        C3p0Plugin cp = new C3p0Plugin("jdbc:mysql://localhost/db_name", "userName", "password");
//        me.add(cp);
//        ActiveRecordPlugin arp = new ActiveRecordPlugin(cp); me.add(arp);
//        arp.addMapping("user", User.class); arp.addMapping("article", "article_id", Article.class);

    }
    public void configInterceptor(Interceptors me) {}
    public void configHandler(Handlers me) {}

}
